package io.github.junxworks.qt;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Import;

import io.github.junxworks.ep.core.EnableGlobalExceptionHandler;
import io.github.junxworks.ep.core.security.access.EnableAccessLog;
import io.github.junxworks.ep.core.security.sql.EnableSQLFilter;
import io.github.junxworks.ep.core.utils.IPUtils;
import io.github.junxworks.ep.core.utils.SpringContextUtils;
import io.github.junxworks.ep.sys.annotations.EnableEPSys;
import io.github.junxworks.junx.core.exception.BaseRuntimeException;

@EnableAccessLog //开启访问日志
@EnableSQLFilter //开启sql注入过滤
@EnableGlobalExceptionHandler //开启全局异常捕获
@EnableEPSys //开启EP基础系统，含人员管理、菜单管理等基础功能，其他模块注解要在这个注解下面
@Import({ SpringContextUtils.class })
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class QtApplication {
	static {
		try {
			IPUtils.initializeServerIP();//如果ip合法，则把IP设置到系统环境变量中，注册到zookeeper的时候会使用到
		} catch (Exception e) {
			throw new BaseRuntimeException(e);
		}
	}
	public static void main(String[] args) {
		SpringApplication.run(QtApplication.class, args);
	}

}
